
#include "sink.hpp"
#include "util.hpp"

int main()
{
    
    wmhLog::message msg(wmhLog::logLevel::value::DEBUG, 66, "man.cc", "root", "简单测试");
    wmhLog::Formatter fmt;
    std::string str = fmt.format(msg);

    wmhLog::LogSink::ptr time_lsp = wmhLog::SinkFactor::create<wmhLog::RollByTimeSink>("./logfile/roll-", wmhLog::TimeGap::GAP_SECOND);

    std::cout<<wmhLog::util::Date::getTime()<<std::endl;


    time_t old=wmhLog::util::Date::getTime();
    while (wmhLog::util::Date::getTime()<old+5)
    {
        time_lsp->log(str.c_str(),str.size());
        // usleep(1000);
    }
}